package hivMultiCompartment;

import java.awt.Color;

// this is a class that contains all global constants. 
// things can be rewritten by input in Model class.
public class GlobalConstants {
	
	//life///////////////////////////////////////////
	public static int avgLifeCD4TNaive = 500;
	public static int avgLifeCD4TActive = 500;
	public static int avgLifeCD4TEffector = 100;
	public static int avgLifeCD4TMemory = 4000;
	
	public static int avgLifeCD8TNaive = 500;
	public static int avgLifeCD8TActive = 500;
	public static int avgLifeCD8TEffector = 100;
	public static int avgLifeCD8TMemory = 4000;
	
	public static int avgLifeBNaive = 2000;
	public static int avgLifeBActive = 2000;
	public static int avgLifeBSLPC = 100;
	public static int avgLifeBLLPC = 500;
	public static int avgLifeBMemory = 5000;
	
	public static int avgLifeAPCImmatrue = 1500;
	public static int avgLifeAPCMature = 1000;
	
	public static int avgLifeVirusActive = 1000;
	
	//movement///////////////////////////////////////////
	
	// enter organs
	public static double probEnterLymphCD4Naive = 0.001;
	public static double probEnterLymphCD4Active = 0.00001;
	public static double probEnterLymphCD4Effector = 0.00001;
	public static double probEnterLymphCD4Memory = 0.0006;
	
	public static double probEnterThymusCD4Naive = 0.0001;
	public static double probEnterThymusCD4Active = 0.0002;
	public static double probEnterThymusCD4Effector = 0.0004;
	public static double probEnterThymusCD4Memory = 0.0003;
	
	public static double probEnterLymphCD8Naive = 0.0005;
	public static double probEnterLymphCD8Active = 0.00001;
	public static double probEnterLymphCD8Effector = 0.002;
	public static double probEnterLymphCD8Memory = 0.0002;
	
	public static double probEnterThymusCD8Naive = 0.0001;
	public static double probEnterThymusCD8Active = 0.0002;
	public static double probEnterThymusCD8Effector = 0.002;
	public static double probEnterThymusCD8Memory = 0.02;
	
	public static double probEnterLymphBNaive = 0.001;
	public static double probEnterLymphBActive = 0.0001;
	public static double probEnterLymphBSLPC = 0.0001;
	public static double probEnterLymphBLLPC = 0.0001;
	public static double probEnterLymphBMemory = 0.0001;
	
	public static double probEnterThymusBNaive = 0;
	public static double probEnterThymusBActive = 0;
	public static double probEnterThymusBSLPC = 0;
	public static double probEnterThymusBLLPC = 0;
	public static double probEnterThymusBMemory = 0;
	
	public static double probEnterLymphVirusActive = 0.002;
	public static double probEnterThymusVirusActive = 0.02;
	
	// exit from port
	public static double probExitCD4TNaive = 1.0;
	public static double probExitCD4TActive = 0.1;
	public static double probExitCD4TEffector = 1.0;
	public static double probExitCD4TMemory = 1.0;
	
	public static double probExitCD8TNaive = 1.0;
	public static double probExitCD8TActive = 0.1;
	public static double probExitCD8TEffector = 1.0;
	public static double probExitCD8TMemory = 1.0;
	
	public static double probExitBNaive = 1.0;
	public static double probExitBActive = 0.1;
	public static double probExitBSLPC = 1.0;
	public static double probExitBLLPC = 1.0;
	public static double probExitBMemory = 1.0;
	
	public static double probExitVirusActive = 1.0;
	
	//cell step
	public static int distancePerStep = 3;
	//movement Intervals
	public static int moveIntervalCD4T = 1;
	public static int moveIntervalCD8T = 1;
	public static int moveIntervalB = 2;
	public static int moveIntervalAPC = 4;
	public static int moveIntervalVirus = 1;
	
	// virus diffusion:
	public static double virusprobMoveStay = 0.3;
	public static double virusprobMoveSide = 0.1;
	public static double virusprobMoveCorner = 0.075;
	
	// new cell recruitment
	public static int recruitCD4TCount = 2;//6;
	public static int recruitCD8TCount = 1;//3;
	public static int recruitBCount = 4;
	public static int recruitAPCCount = 1;
	
	public static int recruitIntervalCD4T = 10;
	public static int recruitIntervalCD8T = 10;
	public static int recruitIntervalB = 10;
	public static int recruitIntervalAPC = 10;
	
	//APC MATUREATION
	public static double maxMatureFrq = 0.5;
	public static double halfMatureFrqLoad = 10;
	
	//proliferation
	public static int doublingTimeCD4TNaive = 515;
	public static int dividingCountCD4TNaive = 1;
	public static int doublingTimeCD4TActive = 2;
	public static int dividingCountCD4TActive = 6;
	
	public static int doublingTimeCD8TNaive = 515;
	public static int dividingCountCD8TNaive = 1;
	public static int doublingTimeCD8TActive = 5;
	public static int dividingCountCD8TActive = 7;
	
	public static int doublingTimeBPC = 10;
	public static int dividingCountBSLPC = 4;
	public static int dividingCountBLLPC = 4;
	
	//virus strain and antigen specificity
	public static int maxStrains = 50;
	public static int maxIdiotypeCD4T = 200;
	public static int maxIdiotypeCD8T = 200;
	public static int maxIdiotypeB = 50;
	
	//memory differentiation
	public static double memoryFrqCD4T = 0.002;
	public static double memoryFrqCD8T = 0.005;
	public static double memoryFrqB = 0.003;
	
	//CD8 killing
	public static double killingEfficiencyActive = 0.2; //without CD4
	public static double killingEfficiencyEffector = 0.9;
	
	//antibody
	public static int antibodyEfficiency = 10;
	public static int antibodyProductionBSLPC = 20;
	public static int antibodyProductionBLLPC = 100;
	public static int antibodyVirusHalfMaxProductLocal = 50;
	public static int antibodyVirusHalfMaxProductBlood = 900000;
	
	//virus reactivation probability
	public static double reactivationRateCD4TResting = 0.00002;
	public static double reactivationRateCD4TActive = 0.004;
	public static double reactivationRateAPC = 0.0002;
	
	//virus mechanism
	public static double probEnterCellOriginal = 0.1;
	public static double probEnterCell = 0.1;
	public static int avgReleaseCountOriginal = 500;
	public static int avgReleaseCount = 500;
	public static int halfImpairVirusLoad = 50;
	public static double virusMutationRate = 0.005;

	
	//activations
	public static int interationRadius = 3;
	public static double probCD4EffectorActivateCD8Active = 1;
	public static double probCD4EffectorActivateBActive = 1;
	public static double probAPCPrimeCD4T = 1;
	public static double probAPCPrimeCD8T = 1;
	public static double probAPCActivateSLPC = 1;
	//assume memory cells are super sensitive
	
	//
	public static double frqSusceptibleAPC = 0.1;
	
	
	//color
	public static Color colorCD4TNaive = new Color(250,250,210);
	public static Color colorCD4TEffector = new Color(255, 255, 0);
	
	public static Color colorCD8TNaive = new Color(132,112,255);
	public static Color colorCD8TEffector = new Color(106, 90, 205);
	
	public static Color colorBNaive = new Color(152,215,152);
	public static Color colorBSLPC = new Color(50, 205, 50);
	
	public static Color colorAPCImmature = new Color(255,192,203);
	public static Color colorAPCMature = new Color(238, 130, 238);
	
	public static Color colorPortEntry = new Color(211, 211, 211);
	public static Color colorPortExit = new Color(150, 150, 150);
	public static Color colorPortDual = new Color(80, 80, 80);
	
	/////////// Methods /////////////////////////////////////////////////////
	/////////

	public static int sampleNormal(double avg) {
		double result = Model.getNormalDouble(avg, avg/5);
		return (int)result;
	}
}
